package cn.com.lsjz.nursemanager.repository.records;

import java.util.Date;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;

import cn.com.lsjz.commons.repository.base.BaseRepository;
import cn.com.lsjz.nursemanager.model.records.DocsEvalReportRec;
import cn.com.lsjz.nursemanager.model.vo.DocsAssReportRecVo;

public interface DocsEvalReportRecRepository extends BaseRepository<DocsEvalReportRec, Integer>{

	
	@Query("  select new cn.com.lsjz.nursemanager.model.vo.DocsAssReportRecVo(t.reportId,t.patientId,"
			+ "	t.visitId,t.reportDate,t.timePoint,t.themeCode,t.remark,t.createTime,"
			+ "	t.creator,t.creatorUnit,t.enableValue) "
			+ " from DocsEvalReportRec t "
			+ " where t.patientId = ?1 and t.visitId = ?2 and t.themeCode = ?3 "
			+ "	and t.timePoint >= ?4  and t.timePoint <= ?5 and t.enableValue = 'Y' ")
	Page<DocsAssReportRecVo> findByTime(String patientId,String visitId,
			String themeCode,Date startTime,Date endTime,Pageable pageable);
	
	
	
	
	
}
